<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.4"/>
<title>SPI Driver: _SPI_DRV Struct Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">SPI Driver
   &#160;<span id="projectnumber">1.1</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.4 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li class="current"><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li><a href="classes.html"><span>Data&#160;Structure&#160;Index</span></a></li>
      <li><a href="functions.html"><span>Data&#160;Fields</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('struct___s_p_i___d_r_v.html','');});
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#pub-attribs">Data Fields</a>  </div>
  <div class="headertitle">
<div class="title">_SPI_DRV Struct Reference<div class="ingroups"><a class="el" href="group__group5.html">SPI Module Driver</a></div></div>  </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-attribs"></a>
Data Fields</h2></td></tr>
<tr class="memitem:a8c2a4272a8f7cb28ef5cb93d2bbdfe7b"><td class="memItemLeft" align="right" valign="top">uint16_t *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct___s_p_i___d_r_v.html#a8c2a4272a8f7cb28ef5cb93d2bbdfe7b">RX_Data</a></td></tr>
<tr class="separator:a8c2a4272a8f7cb28ef5cb93d2bbdfe7b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad272ecadea65ca00df2f0cc9e868ab66"><td class="memItemLeft" align="right" valign="top">uint16_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct___s_p_i___d_r_v.html#ad272ecadea65ca00df2f0cc9e868ab66">RX_end_data</a></td></tr>
<tr class="separator:ad272ecadea65ca00df2f0cc9e868ab66"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9dae312df8e91e96acbefc6054b9b33d"><td class="memItemLeft" align="right" valign="top">uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct___s_p_i___d_r_v.html#a9dae312df8e91e96acbefc6054b9b33d">RX_Data_Size</a></td></tr>
<tr class="separator:a9dae312df8e91e96acbefc6054b9b33d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af48cc5f7cde524793956f5d7b3223b48"><td class="memItemLeft" align="right" valign="top">uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct___s_p_i___d_r_v.html#af48cc5f7cde524793956f5d7b3223b48">RX_Index</a></td></tr>
<tr class="separator:af48cc5f7cde524793956f5d7b3223b48"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aeeb6d504e17e93b5f68871a8902a1192"><td class="memItemLeft" align="right" valign="top">uint16_t *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct___s_p_i___d_r_v.html#aeeb6d504e17e93b5f68871a8902a1192">TX_Data</a></td></tr>
<tr class="separator:aeeb6d504e17e93b5f68871a8902a1192"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a60813ca9863f226c3985a2ea529d6699"><td class="memItemLeft" align="right" valign="top">uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct___s_p_i___d_r_v.html#a60813ca9863f226c3985a2ea529d6699">TX_Data_Size</a></td></tr>
<tr class="separator:a60813ca9863f226c3985a2ea529d6699"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abb6d2bd838d651ea1ce4f67842aa81c4"><td class="memItemLeft" align="right" valign="top">uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct___s_p_i___d_r_v.html#abb6d2bd838d651ea1ce4f67842aa81c4">TX_Index</a></td></tr>
<tr class="separator:abb6d2bd838d651ea1ce4f67842aa81c4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a76c0ed371181cdc8f053170de8144ca2"><td class="memItemLeft" align="right" valign="top">uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct___s_p_i___d_r_v.html#a76c0ed371181cdc8f053170de8144ca2">Completed</a></td></tr>
<tr class="separator:a76c0ed371181cdc8f053170de8144ca2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9ac4c1f881137da2601ed5d333bb5989"><td class="memItemLeft" align="right" valign="top">uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct___s_p_i___d_r_v.html#a9ac4c1f881137da2601ed5d333bb5989">State</a></td></tr>
<tr class="separator:a9ac4c1f881137da2601ed5d333bb5989"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a47cd5611a81f1fdbfaaaf073dac0e975"><td class="memItemLeft" align="right" valign="top">uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct___s_p_i___d_r_v.html#a47cd5611a81f1fdbfaaaf073dac0e975">Error</a></td></tr>
<tr class="separator:a47cd5611a81f1fdbfaaaf073dac0e975"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a38d77c111691a5a74542dd2ca9ccf6ce"><td class="memItemLeft" align="right" valign="top">struct DSPI_tag *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct___s_p_i___d_r_v.html#a38d77c111691a5a74542dd2ca9ccf6ce">DSPI</a></td></tr>
<tr class="separator:a38d77c111691a5a74542dd2ca9ccf6ce"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aead12928b2c4e6898c71c73b32315770"><td class="memItemLeft" align="right" valign="top">void(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct___s_p_i___d_r_v.html#aead12928b2c4e6898c71c73b32315770">init</a> )(int8_t, int32_t)</td></tr>
<tr class="memdesc:aead12928b2c4e6898c71c73b32315770"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initiatlisation method. Must be called before using the driver.<br/>
.  <a href="#aead12928b2c4e6898c71c73b32315770">More...</a><br/></td></tr>
<tr class="separator:aead12928b2c4e6898c71c73b32315770"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aaa043d94a20a9a8b13a062be3944e679"><td class="memItemLeft" align="right" valign="top">void(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct___s_p_i___d_r_v.html#aaa043d94a20a9a8b13a062be3944e679">exchange</a> )(const uint16_t *, uint16_t *)</td></tr>
<tr class="memdesc:aaa043d94a20a9a8b13a062be3944e679"><td class="mdescLeft">&#160;</td><td class="mdescRight">Exchange data (Master). Allows a full-duplex 16-bit data transfer where the module is the master.<br/>
.  <a href="#aaa043d94a20a9a8b13a062be3944e679">More...</a><br/></td></tr>
<tr class="separator:aaa043d94a20a9a8b13a062be3944e679"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a247fbfc90fac794d9c14e81848e53443"><td class="memItemLeft" align="right" valign="top">void(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct___s_p_i___d_r_v.html#a247fbfc90fac794d9c14e81848e53443">write</a> )(const uint16_t *)</td></tr>
<tr class="memdesc:a247fbfc90fac794d9c14e81848e53443"><td class="mdescLeft">&#160;</td><td class="mdescRight">Write data (Master). Allows a half-duplex data transmission where the module will transmit a 16-bit data to a slave.<br/>
.  <a href="#a247fbfc90fac794d9c14e81848e53443">More...</a><br/></td></tr>
<tr class="separator:a247fbfc90fac794d9c14e81848e53443"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0394bc0b91f6bb1a769c0f6added863a"><td class="memItemLeft" align="right" valign="top">void(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct___s_p_i___d_r_v.html#a0394bc0b91f6bb1a769c0f6added863a">read</a> )(uint16_t *)</td></tr>
<tr class="memdesc:a0394bc0b91f6bb1a769c0f6added863a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Read data (Master). Allows a half-duplex data transmission where the module will receive a 16-bit data from a slave and send it an empty frame.<br/>
.  <a href="#a0394bc0b91f6bb1a769c0f6added863a">More...</a><br/></td></tr>
<tr class="separator:a0394bc0b91f6bb1a769c0f6added863a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a086ad89b79b23005b984e80dc5e65b92"><td class="memItemLeft" align="right" valign="top">void(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct___s_p_i___d_r_v.html#a086ad89b79b23005b984e80dc5e65b92">show</a> )(const uint16_t *, int8_t)</td></tr>
<tr class="memdesc:a086ad89b79b23005b984e80dc5e65b92"><td class="mdescLeft">&#160;</td><td class="mdescRight">Write data (Slave). The module will write the data to its TX_Buffer as a slave, ready to be read by a master. It can either run on foreground, in which case the program will wait for the data to be transferred, or it can also run in background, but calling another method of the driver before this data is read will result in its loss. Therefore always wait for the Completed flag before moving on.<br/>
.  <a href="#a086ad89b79b23005b984e80dc5e65b92">More...</a><br/></td></tr>
<tr class="separator:a086ad89b79b23005b984e80dc5e65b92"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9bb35941a1c307a87268f643dcf14397"><td class="memItemLeft" align="right" valign="top">void(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct___s_p_i___d_r_v.html#a9bb35941a1c307a87268f643dcf14397">exchange_array</a> )(const uint16_t *, uint16_t *, int8_t, int8_t)</td></tr>
<tr class="memdesc:a9bb35941a1c307a87268f643dcf14397"><td class="mdescLeft">&#160;</td><td class="mdescRight">Exchange data array (Master). Allows a full-duplex data transmission where the module will transmit an array of 16-bit data to a slave and receive another. The size of the array is limited by the MAX_DATA_SIZE macro. It can either run on foreground, in which case the program will wait for the data to be transferred, or it can also run in background, but calling another method of the driver before this data is read will result in its loss. Therefore always wait for the Completed flag before moving on.<br/>
.  <a href="#a9bb35941a1c307a87268f643dcf14397">More...</a><br/></td></tr>
<tr class="separator:a9bb35941a1c307a87268f643dcf14397"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a41173e3adcf94d40c1aaa34767bf638f"><td class="memItemLeft" align="right" valign="top">void(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct___s_p_i___d_r_v.html#a41173e3adcf94d40c1aaa34767bf638f">write_array</a> )(const uint16_t *, int8_t, int8_t)</td></tr>
<tr class="memdesc:a41173e3adcf94d40c1aaa34767bf638f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Write data array (Master). Allows a half-duplex data transmission where the module will transmit an array of 16-bit data to a slave. The size of the array is limited by the MAX_DATA_SIZE macro. It can either run on foreground, in which case the program will wait for the data to be transferred, or it can also run in background, but calling another method of the driver before this data is read will result in its loss. Therefore always wait for the Completed flag before moving on.<br/>
.  <a href="#a41173e3adcf94d40c1aaa34767bf638f">More...</a><br/></td></tr>
<tr class="separator:a41173e3adcf94d40c1aaa34767bf638f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acacca74950b68d3dfeeb4b43d5a17234"><td class="memItemLeft" align="right" valign="top">void(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct___s_p_i___d_r_v.html#acacca74950b68d3dfeeb4b43d5a17234">read_array</a> )(uint16_t *, int8_t, int8_t)</td></tr>
<tr class="memdesc:acacca74950b68d3dfeeb4b43d5a17234"><td class="mdescLeft">&#160;</td><td class="mdescRight">Read data array (Master). Allows a half-duplex data transmission where the module will receive an array of 16-bit data from a slave and send it empty frames. The size of the array is limited by the MAX_DATA_SIZE macro. It can either run on foreground, in which case the program will wait for the data to be transferred, or it can also run in background, but calling another method of the driver before this data is read will result in its loss. Therefore always wait for the Completed flag before moving on.<br/>
.  <a href="#acacca74950b68d3dfeeb4b43d5a17234">More...</a><br/></td></tr>
<tr class="separator:acacca74950b68d3dfeeb4b43d5a17234"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5f87e1c352b3224fe2a6bed5db0ccf12"><td class="memItemLeft" align="right" valign="top">void(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct___s_p_i___d_r_v.html#a5f87e1c352b3224fe2a6bed5db0ccf12">listen</a> )(uint16_t *, int8_t, int8_t)</td></tr>
<tr class="memdesc:a5f87e1c352b3224fe2a6bed5db0ccf12"><td class="mdescLeft">&#160;</td><td class="mdescRight">Read data array, given size (Slave). Allows a half-duplex data transmission where the module will receive an array of 16-bit data from a master. Can be used for data sniffing. The size of the array is limited by the MAX_DATA_SIZE macro. It can either run on foreground, in which case the program will wait for the data to be transferred, or it can also run in background, but calling another method of the driver before this data is read will result in its loss. Therefore always wait for the Completed flag before moving on.<br/>
.  <a href="#a5f87e1c352b3224fe2a6bed5db0ccf12">More...</a><br/></td></tr>
<tr class="separator:a5f87e1c352b3224fe2a6bed5db0ccf12"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:adca794807f12ed1014f0e08fbf17c695"><td class="memItemLeft" align="right" valign="top">void(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct___s_p_i___d_r_v.html#adca794807f12ed1014f0e08fbf17c695">listen_till</a> )(uint16_t *, uint16_t, int8_t)</td></tr>
<tr class="memdesc:adca794807f12ed1014f0e08fbf17c695"><td class="mdescLeft">&#160;</td><td class="mdescRight">Read data array, given terminating data (Slave). Allows a half-duplex data transmission where the module will receive an array of 16-bit data from a master until it receives a terminating data. Can be used for data sniffing. The size of the array is limited by the MAX_DATA_SIZE macro. It can either run on foreground, in which case the program will wait for the data to be transferred, or it can also run in background, but calling another method of the driver before this data is read will result in its loss. Therefore always wait for the Completed flag before moving on.<br/>
.  <a href="#adca794807f12ed1014f0e08fbf17c695">More...</a><br/></td></tr>
<tr class="separator:adca794807f12ed1014f0e08fbf17c695"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa5e2288fb7202e84696e40a0e35b16b7"><td class="memItemLeft" align="right" valign="top">void(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct___s_p_i___d_r_v.html#aa5e2288fb7202e84696e40a0e35b16b7">show_array</a> )(const uint16_t *, int8_t, int8_t)</td></tr>
<tr class="memdesc:aa5e2288fb7202e84696e40a0e35b16b7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Write data array (Slave). The module will write the data to its TX_Buffer as a slave, ready to be read by a master.The size of the array is limited by the MAX_DATA_SIZE macro. It can either run on foreground, in which case the program will wait for the data to be transferred, or it can also run in background, but calling another method of the driver before this data is read will result in its loss. Therefore always wait for the Completed flag before moving on.<br/>
.  <a href="#aa5e2288fb7202e84696e40a0e35b16b7">More...</a><br/></td></tr>
<tr class="separator:aa5e2288fb7202e84696e40a0e35b16b7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5684ac71e5067cfaf0edf2fd8870e871"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a5684ac71e5067cfaf0edf2fd8870e871"></a>
void(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct___s_p_i___d_r_v.html#a5684ac71e5067cfaf0edf2fd8870e871">EOQI_Handler</a> )(void)</td></tr>
<tr class="memdesc:a5684ac71e5067cfaf0edf2fd8870e871"><td class="mdescLeft">&#160;</td><td class="mdescRight">End of Queue Interrupt Handler (Unused). The handler is not vectored to the INTC in this version. The user can activate it by modifying initialise_SPI_DRIVER function and by adding a EOQ command to the final transmission in previous methods. <br/></td></tr>
<tr class="separator:a5684ac71e5067cfaf0edf2fd8870e871"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab88d0229b263cbe779f1a0ea8a1bb20c"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ab88d0229b263cbe779f1a0ea8a1bb20c"></a>
void(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct___s_p_i___d_r_v.html#ab88d0229b263cbe779f1a0ea8a1bb20c">TCI_Handler</a> )(void)</td></tr>
<tr class="memdesc:ab88d0229b263cbe779f1a0ea8a1bb20c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Transfer Complete Interrupt Handler. An interrupt handler that clears the flag and the proceeds on doing a treatment depending on the state of the driver. The user can customise and add new states if needed, current states are:<br/>
 0xFF: idle,<br/>
 0x01: master/slave tx<br/>
 0x02: slave rx(knowing array size)<br/>
 0x03: slave rx(knowing terminating data)<br/>
. <br/></td></tr>
<tr class="separator:ab88d0229b263cbe779f1a0ea8a1bb20c"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock">
<p>Definition at line <a class="el" href="spi__drv_8h_source.html#l00292">292</a> of file <a class="el" href="spi__drv_8h_source.html">spi_drv.h</a>.</p>
</div><h2 class="groupheader">Field Documentation</h2>
<a class="anchor" id="a76c0ed371181cdc8f053170de8144ca2"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint8_t Completed</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>A flag to indicate transfer status:<br/>
 1: transfer completed,<br/>
 0: ongoing transfer(or never happened). </p>

<p>Definition at line <a class="el" href="spi__drv_8h_source.html#l00302">302</a> of file <a class="el" href="spi__drv_8h_source.html">spi_drv.h</a>.</p>

</div>
</div>
<a class="anchor" id="a38d77c111691a5a74542dd2ca9ccf6ce"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">struct DSPI_tag* DSPI</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>A pointer to the DSPI module for accesing peripheral registers. </p>

<p>Definition at line <a class="el" href="spi__drv_8h_source.html#l00306">306</a> of file <a class="el" href="spi__drv_8h_source.html">spi_drv.h</a>.</p>

</div>
</div>
<a class="anchor" id="a47cd5611a81f1fdbfaaaf073dac0e975"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint8_t Error</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>An error flag. (Not used in this version.) </p>

<p>Definition at line <a class="el" href="spi__drv_8h_source.html#l00305">305</a> of file <a class="el" href="spi__drv_8h_source.html">spi_drv.h</a>.</p>

</div>
</div>
<a class="anchor" id="aaa043d94a20a9a8b13a062be3944e679"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void(* exchange)(const uint16_t *, uint16_t *)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Exchange data (Master). Allows a full-duplex 16-bit data transfer where the module is the master.<br/>
. </p>
<pre class="fragment">                            Example: SPI[0].exchange(&amp;command, &amp;status); 
                            A command is sent and status of the slave is received.
</pre><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">int16_t*</td><td>TX_data : give the adress of the TX data to be sent,<br/>
 </td></tr>
    <tr><td class="paramname">int16_t*</td><td>RX_data : give the adress where RX data will be stored.<br/>
 </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="spi__drv_8h_source.html#l00317">317</a> of file <a class="el" href="spi__drv_8h_source.html">spi_drv.h</a>.</p>

</div>
</div>
<a class="anchor" id="a9bb35941a1c307a87268f643dcf14397"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void(* exchange_array)(const uint16_t *, uint16_t *, int8_t, int8_t)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Exchange data array (Master). Allows a full-duplex data transmission where the module will transmit an array of 16-bit data to a slave and receive another. The size of the array is limited by the MAX_DATA_SIZE macro. It can either run on foreground, in which case the program will wait for the data to be transferred, or it can also run in background, but calling another method of the driver before this data is read will result in its loss. Therefore always wait for the Completed flag before moving on.<br/>
. </p>
<pre class="fragment">                                Example: where SPI1 and SPI0 are connected
                                    SPI[1].show_array((uint16_t*)"PWM enabled.\0\0",7,1);
                                    SPI[0].exchange_array((uint16_t*)"Show me your UART status.\0\0\0", RX_data,14,1);
                                    while (!(SPI[1].Completed &amp;&amp; SPI[0].Completed)){}

                                Result:
                                TX_data =  "Show me your UART status.\0\0\0"
                                RX_data =  "PWM enabled.\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
</pre><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">const</td><td>uint16_t* TX_data: give the adress of the TX data array to be sent.<br/>
 </td></tr>
    <tr><td class="paramname">uint16_t*</td><td>RX_data : address of RX data storage array.<br/>
 </td></tr>
    <tr><td class="paramname">int8_t</td><td>size: size of the data array<br/>
 </td></tr>
    <tr><td class="paramname">int8_t</td><td>intrpt_en: if not null the method will run in the background, else foreground.<br/>
 </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="spi__drv_8h_source.html#l00363">363</a> of file <a class="el" href="spi__drv_8h_source.html">spi_drv.h</a>.</p>

</div>
</div>
<a class="anchor" id="aead12928b2c4e6898c71c73b32315770"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void(* init)(int8_t, int32_t)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Initiatlisation method. Must be called before using the driver.<br/>
. </p>
<pre class="fragment">                Example: SPI[0].init(SPI_BAUD_62500, SPI_DELAY_DEFAULT);
</pre><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">int8_t</td><td>baud_rate : use an 8-bit baud-rate macro,<br/>
 </td></tr>
    <tr><td class="paramname">int32_t</td><td>delay : use a 32-bit delay attributes macro.<br/>
 </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="spi__drv_8h_source.html#l00308">308</a> of file <a class="el" href="spi__drv_8h_source.html">spi_drv.h</a>.</p>

</div>
</div>
<a class="anchor" id="a5f87e1c352b3224fe2a6bed5db0ccf12"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void(* listen)(uint16_t *, int8_t, int8_t)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Read data array, given size (Slave). Allows a half-duplex data transmission where the module will receive an array of 16-bit data from a master. Can be used for data sniffing. The size of the array is limited by the MAX_DATA_SIZE macro. It can either run on foreground, in which case the program will wait for the data to be transferred, or it can also run in background, but calling another method of the driver before this data is read will result in its loss. Therefore always wait for the Completed flag before moving on.<br/>
. </p>
<pre class="fragment">                            Example: where SPI1 and SPI0 are connected          
                                    SPI[1].write_array((uint16_t*)"Coucou!\0",4,1);                                                             
                                    while (!(SPI[0].Completed &amp;&amp; SPI[1].Completed)){}
</pre><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">uint16_t*</td><td>RX_data : give the adress where RX data will be stored<br/>
 </td></tr>
    <tr><td class="paramname">int8_t</td><td>size: size of the data array </td></tr>
    <tr><td class="paramname">int8_t</td><td>intrpt_en: if not null the method will run in the background, else foreground.<br/>
 </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="spi__drv_8h_source.html#l00419">419</a> of file <a class="el" href="spi__drv_8h_source.html">spi_drv.h</a>.</p>

</div>
</div>
<a class="anchor" id="adca794807f12ed1014f0e08fbf17c695"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void(* listen_till)(uint16_t *, uint16_t, int8_t)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Read data array, given terminating data (Slave). Allows a half-duplex data transmission where the module will receive an array of 16-bit data from a master until it receives a terminating data. Can be used for data sniffing. The size of the array is limited by the MAX_DATA_SIZE macro. It can either run on foreground, in which case the program will wait for the data to be transferred, or it can also run in background, but calling another method of the driver before this data is read will result in its loss. Therefore always wait for the Completed flag before moving on.<br/>
. </p>
<pre class="fragment">                            Example: where SPI1 and SPI0 are connected
                                SPI[1].listen_till((RxData+60), 0,1);
                                SPI[0].write_array((uint16_t*)"The night is dark, and full of terror.\0\0",20,1);
                                while (!(SPI[1].Completed &amp;&amp; SPI[0].Completed)){}
</pre><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">uint16_t*</td><td>RX_data : give the adress where RX data will be stored<br/>
 </td></tr>
    <tr><td class="paramname">uint16_t</td><td>end_data: the RX data that will put and end to the transfer </td></tr>
    <tr><td class="paramname">int8_t</td><td>intrpt_en: if not null the method will run in the background, else foreground.<br/>
 </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="spi__drv_8h_source.html#l00436">436</a> of file <a class="el" href="spi__drv_8h_source.html">spi_drv.h</a>.</p>

</div>
</div>
<a class="anchor" id="a0394bc0b91f6bb1a769c0f6added863a"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void(* read)(uint16_t *)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Read data (Master). Allows a half-duplex data transmission where the module will receive a 16-bit data from a slave and send it an empty frame.<br/>
. </p>
<pre class="fragment">            Example:        uint16_t i;
                            SPI[0].read(&amp;i);
            Received data is stored in i.
</pre><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">uint16_t*</td><td>RX_data : give the adress where RX data will be stored<br/>
 </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="spi__drv_8h_source.html#l00338">338</a> of file <a class="el" href="spi__drv_8h_source.html">spi_drv.h</a>.</p>

</div>
</div>
<a class="anchor" id="acacca74950b68d3dfeeb4b43d5a17234"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void(* read_array)(uint16_t *, int8_t, int8_t)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Read data array (Master). Allows a half-duplex data transmission where the module will receive an array of 16-bit data from a slave and send it empty frames. The size of the array is limited by the MAX_DATA_SIZE macro. It can either run on foreground, in which case the program will wait for the data to be transferred, or it can also run in background, but calling another method of the driver before this data is read will result in its loss. Therefore always wait for the Completed flag before moving on.<br/>
. </p>
<pre class="fragment">                            Example: where SPI1 and SPI0 are connected          
                                    SPI[1].show_array((uint16_t*)"Lannisters send their regards.",16,1);
                                    SPI[0].read_array(RxData+85,16,0);                                                              
                                    while (!(SPI[0].Completed &amp;&amp; SPI[1].Completed)){}
</pre><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">uint16_t*</td><td>RX_data : give the adress where RX data will be stored<br/>
 </td></tr>
    <tr><td class="paramname">int8_t</td><td>size: size of the data array </td></tr>
    <tr><td class="paramname">int8_t</td><td>intrpt_en: if not null the method will run in the background, else foreground.<br/>
 </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="spi__drv_8h_source.html#l00402">402</a> of file <a class="el" href="spi__drv_8h_source.html">spi_drv.h</a>.</p>

</div>
</div>
<a class="anchor" id="a8c2a4272a8f7cb28ef5cb93d2bbdfe7b"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint16_t* RX_Data</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>A pointer to the received data (array or not). </p>

<p>Definition at line <a class="el" href="spi__drv_8h_source.html#l00294">294</a> of file <a class="el" href="spi__drv_8h_source.html">spi_drv.h</a>.</p>

</div>
</div>
<a class="anchor" id="a9dae312df8e91e96acbefc6054b9b33d"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint8_t RX_Data_Size</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>A variable that holds RX_Data's size once a transfer is completed. </p>

<p>Definition at line <a class="el" href="spi__drv_8h_source.html#l00297">297</a> of file <a class="el" href="spi__drv_8h_source.html">spi_drv.h</a>.</p>

</div>
</div>
<a class="anchor" id="ad272ecadea65ca00df2f0cc9e868ab66"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint16_t RX_end_data</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>A value used as the terminating character of the RX_array while listening/sniffing to an undetermined amount of data. (Limited to SPI_MAX_DATA_SIZE) </p>

<p>Definition at line <a class="el" href="spi__drv_8h_source.html#l00295">295</a> of file <a class="el" href="spi__drv_8h_source.html">spi_drv.h</a>.</p>

</div>
</div>
<a class="anchor" id="af48cc5f7cde524793956f5d7b3223b48"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint8_t RX_Index</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>An internal index used for writing data to the RX array. </p>

<p>Definition at line <a class="el" href="spi__drv_8h_source.html#l00298">298</a> of file <a class="el" href="spi__drv_8h_source.html">spi_drv.h</a>.</p>

</div>
</div>
<a class="anchor" id="a086ad89b79b23005b984e80dc5e65b92"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void(* show)(const uint16_t *, int8_t)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Write data (Slave). The module will write the data to its TX_Buffer as a slave, ready to be read by a master. It can either run on foreground, in which case the program will wait for the data to be transferred, or it can also run in background, but calling another method of the driver before this data is read will result in its loss. Therefore always wait for the Completed flag before moving on.<br/>
. </p>
<pre class="fragment">            Example:        uint16_t i=0xD6E1;
                            SPI[0].show(&amp;i,1);
            0xD6E1 is ready to be read by a master.
</pre><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">uint16_t*</td><td>TX_data : give the adress of the TX data to be sent.<br/>
 </td></tr>
    <tr><td class="paramname">int8_t</td><td>intrpt_en: if not null the method will run in the background, else foreground.<br/>
 </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="spi__drv_8h_source.html#l00348">348</a> of file <a class="el" href="spi__drv_8h_source.html">spi_drv.h</a>.</p>

</div>
</div>
<a class="anchor" id="aa5e2288fb7202e84696e40a0e35b16b7"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void(* show_array)(const uint16_t *, int8_t, int8_t)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Write data array (Slave). The module will write the data to its TX_Buffer as a slave, ready to be read by a master.The size of the array is limited by the MAX_DATA_SIZE macro. It can either run on foreground, in which case the program will wait for the data to be transferred, or it can also run in background, but calling another method of the driver before this data is read will result in its loss. Therefore always wait for the Completed flag before moving on.<br/>
. </p>
<pre class="fragment">                            Example: where SPI1 and SPI0 are connected          
                                    SPI[1].show_array((uint16_t*)"Lannisters send their regards.",16,1);
                                    SPI[0].read_array(RxData+85,16,0);                                                              
                                    while (!(SPI[0].Completed &amp;&amp; SPI[1].Completed)){}
</pre><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">uint16_t*</td><td>TX_data : give the adress of the TX data to be sent.<br/>
 </td></tr>
    <tr><td class="paramname">int8_t</td><td>size: size of the data array </td></tr>
    <tr><td class="paramname">int8_t</td><td>intrpt_en: if not null the method will run in the background, else foreground.<br/>
 </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="spi__drv_8h_source.html#l00455">455</a> of file <a class="el" href="spi__drv_8h_source.html">spi_drv.h</a>.</p>

</div>
</div>
<a class="anchor" id="a9ac4c1f881137da2601ed5d333bb5989"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint8_t State</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>An internal state variable used in Transfer Complete interrupts:<br/>
 0xFF: idle,<br/>
 0x01: master/slave tx<br/>
 0x02: slave rx(known array size)<br/>
 0x03: slave rx(known terminating data)<br/>
 </p>

<p>Definition at line <a class="el" href="spi__drv_8h_source.html#l00303">303</a> of file <a class="el" href="spi__drv_8h_source.html">spi_drv.h</a>.</p>

</div>
</div>
<a class="anchor" id="aeeb6d504e17e93b5f68871a8902a1192"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint16_t* TX_Data</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>A pointer to the transmitted data (array or not). </p>

<p>Definition at line <a class="el" href="spi__drv_8h_source.html#l00299">299</a> of file <a class="el" href="spi__drv_8h_source.html">spi_drv.h</a>.</p>

</div>
</div>
<a class="anchor" id="a60813ca9863f226c3985a2ea529d6699"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint8_t TX_Data_Size</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>A variable that holds TX_Data's size once a transfer is started. </p>

<p>Definition at line <a class="el" href="spi__drv_8h_source.html#l00300">300</a> of file <a class="el" href="spi__drv_8h_source.html">spi_drv.h</a>.</p>

</div>
</div>
<a class="anchor" id="abb6d2bd838d651ea1ce4f67842aa81c4"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint8_t TX_Index</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>An internal index used for writing data to the TX array. </p>

<p>Definition at line <a class="el" href="spi__drv_8h_source.html#l00301">301</a> of file <a class="el" href="spi__drv_8h_source.html">spi_drv.h</a>.</p>

</div>
</div>
<a class="anchor" id="a247fbfc90fac794d9c14e81848e53443"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void(* write)(const uint16_t *)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Write data (Master). Allows a half-duplex data transmission where the module will transmit a 16-bit data to a slave.<br/>
. </p>
<pre class="fragment">            Example:        uint16_t i=0xD6E1;
                            SPI[0].write(&amp;i);
            0xD6E1 is sent to a slave.
</pre><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">uint16_t*</td><td>TX_data : give the adress of the TX data to be sent.<br/>
 </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="spi__drv_8h_source.html#l00328">328</a> of file <a class="el" href="spi__drv_8h_source.html">spi_drv.h</a>.</p>

</div>
</div>
<a class="anchor" id="a41173e3adcf94d40c1aaa34767bf638f"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void(* write_array)(const uint16_t *, int8_t, int8_t)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Write data array (Master). Allows a half-duplex data transmission where the module will transmit an array of 16-bit data to a slave. The size of the array is limited by the MAX_DATA_SIZE macro. It can either run on foreground, in which case the program will wait for the data to be transferred, or it can also run in background, but calling another method of the driver before this data is read will result in its loss. Therefore always wait for the Completed flag before moving on.<br/>
. </p>
<pre class="fragment">                                Example: where SPI1 and SPI0 are connected
                                    SPI[1].listen_till((RxData+60), 0,1);
                                    SPI[0].write_array((uint16_t*)"The night is dark, and full of terror.\0\0",20,1);
                                    while (!(SPI[1].Completed &amp;&amp; SPI[0].Completed)){}
</pre><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">uint16_t*</td><td>TX_data: give the adress of the TX data array to be sent.<br/>
 </td></tr>
    <tr><td class="paramname">int8_t</td><td>size: size of the data array </td></tr>
    <tr><td class="paramname">int8_t</td><td>intrpt_en: if not null the method will run in the background, else foreground.<br/>
 </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="spi__drv_8h_source.html#l00385">385</a> of file <a class="el" href="spi__drv_8h_source.html">spi_drv.h</a>.</p>

</div>
</div>
<hr/>The documentation for this struct was generated from the following file:<ul>
<li>drv/<a class="el" href="spi__drv_8h_source.html">spi_drv.h</a></li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="struct___s_p_i___d_r_v.html">_SPI_DRV</a></li>
    <li class="footer">Generated on Mon Aug 19 2013 09:51:11 for SPI Driver by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.4 </li>
  </ul>
</div>
</body>
</html>
